/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package enterprise.ent;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author JAVIER
 */
@Entity
@Table(name = "torneos")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Torneos.findAll", query = "SELECT t FROM Torneos t"),
    @NamedQuery(name = "Torneos.findByIdLiga", query = "SELECT t FROM Torneos t WHERE t.idLiga = :idLiga"),
    @NamedQuery(name = "Torneos.findByIdDeporte", query = "SELECT t FROM Torneos t WHERE t.idDeporte = :idDeporte"),
    @NamedQuery(name = "Torneos.findByLigaAdmin", query = "SELECT t FROM Torneos t WHERE t.ligaAdmin = :ligaAdmin"),
    @NamedQuery(name = "Torneos.findByLigaAdminOrderByFecha", query = "SELECT t FROM Torneos t WHERE t.ligaAdmin = :ligaAdmin and t.ligaEstado < 5 order by t.ligaFecalta desc"),
    @NamedQuery(name = "Torneos.findByLigaAdminContador", query = "SELECT Count(t) as contador FROM Torneos t WHERE t.ligaAdmin = :ligaAdmin"),
    @NamedQuery(name = "Torneos.findByLigaTorneo", query = "SELECT t FROM Torneos t WHERE t.ligaTorneo = :ligaTorneo"),
    @NamedQuery(name = "Torneos.findByLigaFecalta", query = "SELECT t FROM Torneos t WHERE t.ligaFecalta = :ligaFecalta"),
    @NamedQuery(name = "Torneos.findByLigaTipo", query = "SELECT t FROM Torneos t WHERE t.ligaTipo = :ligaTipo"),
    @NamedQuery(name = "Torneos.findByLigaEstado", query = "SELECT t FROM Torneos t WHERE t.ligaEstado = :ligaEstado"),
    @NamedQuery(name = "Torneos.findByLike", query = "SELECT t FROM Torneos t WHERE t.ligaTorneo like :pbusqueda")})
public class Torneos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_liga")
    private Integer idLiga;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_deporte")
    private int idDeporte;
    @Basic(optional = false)
    @NotNull
    @Column(name = "liga_admin")
    private Long ligaAdmin;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 60)
    @Column(name = "liga_torneo")
    private String ligaTorneo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "liga_fecalta")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ligaFecalta;
    @Basic(optional = false)
    @NotNull
    @Column(name = "liga_tipo")
    private int ligaTipo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "liga_estado")
    private Integer ligaEstado;

    public Torneos() {
    }

    public Torneos(Integer idLiga) {
        this.idLiga = idLiga;
    }

    public Torneos(Integer idLiga, int idDeporte, Long ligaAdmin, String ligaTorneo, Date ligaFecalta, int ligaTipo, Integer ligaEstado) {
        this.idLiga = idLiga;
        this.idDeporte = idDeporte;
        this.ligaAdmin = ligaAdmin;
        this.ligaTorneo = ligaTorneo;
        this.ligaFecalta = ligaFecalta;
        this.ligaTipo = ligaTipo;
        this.ligaEstado = ligaEstado;
    }

    public Integer getIdLiga() {
        return idLiga;
    }

    public void setIdLiga(Integer idLiga) {
        this.idLiga = idLiga;
    }

    public int getIdDeporte() {
        return idDeporte;
    }

    public void setIdDeporte(int idDeporte) {
        this.idDeporte = idDeporte;
    }

    public Long getLigaAdmin() {
        return ligaAdmin;
    }

    public void setLigaAdmin(Long ligaAdmin) {
        this.ligaAdmin = ligaAdmin;
    }

    public String getLigaTorneo() {
        return ligaTorneo;
    }

    public void setLigaTorneo(String ligaTorneo) {
        this.ligaTorneo = ligaTorneo;
    }

    public Date getLigaFecalta() {
        return ligaFecalta;
    }

    public void setLigaFecalta(Date ligaFecalta) {
        this.ligaFecalta = ligaFecalta;
    }

    public int getLigaTipo() {
        return ligaTipo;
    }

    public void setLigaTipo(int ligaTipo) {
        this.ligaTipo = ligaTipo;
    }

    public Integer getLigaEstado() {
        return ligaEstado;
    }

    public void setLigaEstado(Integer ligaEstado) {
        this.ligaEstado = ligaEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLiga != null ? idLiga.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Torneos)) {
            return false;
        }
        Torneos other = (Torneos) object;
        if ((this.idLiga == null && other.idLiga != null) || (this.idLiga != null && !this.idLiga.equals(other.idLiga))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "enterprise.ent.Torneos[ idLiga=" + idLiga + " ]";
    }
    
}
